package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._0._2重构继承;

/**
 * @ClassName Animal
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/9 7:21 PM
 * @Version 1.0
 */
public class Animal {
    protected String name;
    protected int shoutNum;

    public Animal() {
        this.name = "niming";
    }

    public Animal(String name) {
        this.name = name;
    }

    public int getShoutNum() {
        return shoutNum;
    }

    public void setShoutNum(int shoutNum) {
        this.shoutNum = shoutNum;
    }

    public String shout() {
        String result = "";
        for (int i = 0; i < this.shoutNum; i++) {
            result += getShoutSound() + ", ";
        }
        return "我的名字叫" + name + " " + result;
    }

    protected String getShoutSound() {
        return "";
    }

}
